<?php
/*
 * @Author: your name
 * @Date: 2020-06-05 17:32:41
 * @LastEditTime: 2020-10-26 14:39:44
 * @LastEditors: Please set LastEditors
 * @Description: 客户端向服务端发起注册请求
 * @FilePath: /special/application/api/controller/ClientRegisterController.php
 */

namespace app\api\controller;

use app\api\service\client_register\ClientRegisterService;

class ClientRegisterController extends BaseController
{
    /**
     * @name: 注册
     * @Param: 
     * @Description: 客户端注册接口
     * @Author: foo
     * @Date: 2019-11-06 17:14:26
     */
    public function reg ()
    {
        $inputData = $this->filterInput();//输入数据
        $this->addRuntimeLog('../runtime/client_register.log', json_encode($inputData));

        $Register = new ClientRegisterService();
        $Register->reg($inputData);

        //返回数据
        $data = [
            'host_id' => $Register->host_id,
            'hostkey' => $Register->host_key,
        ];
        return $this->jsonOutPut($data);
    }
}